//
//  DesCollectTVC.m
//  HappyTrip
//
//  Created by yuxuesong on 15-4-1.
//  Copyright (c) 2015年 lanou3g.com 蓝鸥科技. All rights reserved.
//

#import "DesCollectTVC.h"

@implementation DesCollectTVC


- (void)dealloc
{
    [_picView release];
    [_nameLabel release];
    [super dealloc];
}

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        self.nameLabel = [[UILabel alloc] init];
        _nameLabel.backgroundColor = [UIColor colorWithRed:250.0 / 255.0 green:240.0 / 255.0 blue:220.0 / 255.0 alpha:1.0];
        [self.contentView addSubview:_nameLabel];
        
//        self.picView = [[UIImageView alloc] init];
//        _picView.backgroundColor = [UIColor orangeColor];
//        [self.contentView addSubview:_picView];
//        [_picView release];
    }
    return self;
}

- (void)layoutSubviews
{
    CGFloat width = self.bounds.size.width;
    CGFloat height = self.bounds.size.height;
//    _picView.frame = CGRectMake(10, 0, width / 2, height);
    
    _nameLabel.frame = CGRectMake(0, 0, width, height);
    _nameLabel.textAlignment = NSTextAlignmentCenter;
    _nameLabel.backgroundColor = [UIColor colorWithRed:51.0 / 255.0 green:51.0 / 255.0 blue:102.0 / 255.0 alpha:0.7];
    _nameLabel.layer.cornerRadius = 10;
    _nameLabel.layer.borderWidth = 1.0f;
    _nameLabel.textColor = [UIColor whiteColor];
    _nameLabel.layer.borderColor = [UIColor colorWithRed:255.0 / 255.0 green:204.0 / 255.0 blue:159.0 / 255.0 alpha:1.0].CGColor;
}
- (void)setDetailObj:(DestinationDetailObject *)detailObj
{
    if (_detailObj != detailObj) {
        [_detailObj release];
        _detailObj = [detailObj retain];
    }
//    [_picView setImageWithURL:[NSURL URLWithString:_detailObj.cover] placeholderImage:[UIImage imageNamed:@"placeholder.jpg"]];
    _nameLabel.text = _detailObj.name;
}


- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
